home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
001-025
/
disk_013
/
pinwheel.bas
< prev
next >
Wrap
BASIC Source File
|
1992-05-06
|
3KB
|
75 lines
10 rem downloaded from compuserve 10/29/85 REP
20 rem [72746,1424]
30 rem PINWHE.BAS 27-Oct-85 2435 Accesses: 45
40 rem
50 rem Keywords: GRAPHIC ANIMATION COLOR
60 rem
70 rem A quick re-hack of a program originally done for the Tandy 2000.
80 rem Manipulates the color registers to achieve spin of the pinwheels. Named
90 rem Pinwheels.bas on my Amiga. Not as good as PolyScope, but fun none the less.
95 rem -=DB=-
100 'PINWHEELS.BAS
110 RANDOMIZE
115 '******* Arrays to store rgb info from color registers
120 DIM red%(15),green%(15),blue%(15)
130 SCREEN 1,4,0
135 '******* Save the color registers
140 FOR register%=0 to 15
150 ASK RGB register%,r%,g%,b%
160 red%(register%)=r%:green%(register%)=g%:blue%(register%)=b%
170 NEXT register%
175 '******* Make the "dark" blue ABasiC background go away.
176 '******* Add ":RGB 2,0,0,0" to black the frame.
180 RGB 0,0,0,0
190 SCNCLR
195 '******* Set up our constants
200 M=3.141593/180:Xmax%=640:Ymax%=200
205 '******* and entering variables
210 color%=3:inkey$=""
215 '******* MAIN LOOP
220 WHILE inkey$=""
230 angle1=INT(121*RND)+59:increment=(INT(4*RND)+1)/2
240 px=INT(Xmax%/2):py=INT(Ymax%/2):angle2=angle1:p=increment:y=1
250 LOCATE (px,py)
255 '******* DRAW LOOP
260 WHILE y>0 AND y<Ymax%
270 x=2*p*COS(M*angle2)+px:y=p*SIN(M*angle2)+py
280 DRAW (TO x,y),Color%
290 p=p+increment:angle2=angle2+angle1:px=x:py=y
300 color%=color%+1:IF color%=16 THEN color%=3
310 WEND 'end draw loop
315 '******* blank the picture
320 FOR register%=3 to 15:RGB register%,0,0,0:NEXT register%
325 '******* pick a color
330 r%=INT(15*RND+1):g%=INT(15*RND+1):b%=INT(15*RND+1)
335 'Start to spin the pinwheel
340 FOR spins%=1 TO 10
350 FOR register%=3 to 15
360 RGB register%,r%,g%,b%
370 FOR delay%=1 to 50:NEXT delay%
380 RGB register%,0,0,0
390 NEXT register%
400 NEXT spins%
405 '******* end of spin
410 SCNCLR
415 '******* restore colors to registers 3-15
420 FOR register%=3 TO 15
430 RGB register%,red%(register%),green%(register%),blue%(register%)
440 NEXT register%
445 '******* pole the keyboard for inkey$
450 GET inkey$
460 WEND 'end main loop
465 '******* if a key was pressed we are out. restore register 0
466 '******* also restore register 2 [:RGB 2,red%(2),green%(2),blue%(2)]
466 '******* if you tinkered with it.
470 RGB 0,red%(0),green%(0),blue%(0)
480 END
490 'Pinwheels.bas
500 'Originally hacked for the Tandy 2000 1/85
510 'Rehacked for the Amiga(ABasiC) 10/25/85
520 'Dennis Brunskill 72746,1424
530 '
540 'BE SURE to exit the program by pressing a key and wait a bit
550 'otherwise you'll be typing in the dark. -=DB=-